import request from "../uitls/request.js";
//用户登录
export const userLogin = (data, code) => {
	return request({
		url: 'user/login?code=' + code,
		method: 'POST',
		params: data
	})
}
//获取用户头像
export const getUserAvatar = (idCard) => {
	return request({
		url: 'user/getUserAvatar',
		method: "GET",
		params: {
			idCard: idCard
		}
	})
}

//依据id获取用户信息
export const getUserById = () => {
	return request({
		url: 'user/getOne',
		method: "GET",
		params: {
			userId: uni.getStorageSync("userId")
		}
	})
}
//修改用户信息
export const updateUser = (data) => {
	return request({
		url: 'user/update',
		method: "POST",
		params: {
			...data,
			userId: uni.getStorageSync("userId")
		}
	})
}
//无感登录
export const autoLogin = (code)=>{
	return request({
		url:'user/autoLogin?code='+code,
		method:"GET"
	})
}